package bookoperation;

import book.Book;
import book.BookList;

import java.util.Scanner;

public class FindBook implements IOperation{
    @Override
    public void show(BookList bookList) {

        int size = bookList.getUseSize();
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入你要找的书名:>");
        String name = scanner.nextLine();

        for (int i = 0; i < size; i++) {
            Book ret = bookList.getBooks(i);
            if (name.equals(ret.getBookName())) {
                System.out.println(ret);
            }
        }
        System.out.println("没有此书!");
    }
}
